package com.vend.common.db.commondata;

import android.text.TextUtils;

/**
 * Created by glendal on 2022/01/10.
 */
public class CommonData {
    public static final String VERSION_CODE = "VERSION_CODE";
    private String versionCode = "";
    public String getVersionCode() {
        if (TextUtils.isEmpty(versionCode)) {
            versionCode = SPHelper.instance().getValue(VERSION_CODE);
        }
        return versionCode;
    }
    public static CommonData getInstance() {
        return SingleHolder.common;
    }
    private static class SingleHolder {
        private static final CommonData common = new CommonData();
    }

    public void setVersionCode(String versionCode) {
        this.versionCode = versionCode;
        SPHelper.instance().putData(VERSION_CODE, versionCode);
    }
}
